package simulation;

public class Util {
  /**
   * @param d
   * @param earthRadius
   * @return
   */
  public static float cLattitudeCircum(double d, double earthRadius) {
    double latRadius = earthRadius * Math.sin(Math.toRadians(90 - d));
    return (float) ((2.0 * latRadius) * Math.PI);
  }

  /**
   * @param t
   * @param b
   * @param h
   * @return
   */
  public static float cTrapezoidArea(double t, double b, double h) {
    return (float) ((.5 * h) * (t + b));
  }

  /**
   * @param t
   * @param b
   * @param h
   * @return
   */
  public static float cTrapezoidSideLen(double t, double b, double h) {
    return (float) Math.sqrt(Math.pow((Math.abs(t - b) / 2), 2) + Math.pow(h, 2));
  }

  /**
   * @param d
   * @param r
   * @return
   */
  public static float distToEquator(double d, double r) {
    return (float) (r * Math.sin(Math.toRadians(d)));
  }
  
}
